let main_box = document.querySelector("#main_box ul");

const xhr1 = new XMLHttpRequest();
xhr1.open("get","http://chst.vip:1234/api/getsitenav",true);
xhr1.onload = function(){
    if(xhr1.status === 200){
        let res1 = JSON.parse(xhr1.responseText);
        console.log(res1);

        let main_boxs = "";
        res1.result.forEach(item => {
            main_boxs += `<li>
                            <a href="${item.navHref}">
                                <img src="${item.navImg}">
                                <span>${item.navTitle}</span>
                            </a>
                        </li>`
        });
        main_box.innerHTML = main_boxs;
    }
}
xhr1.send(null);